package com.itheima.service.iml;

import com.itheima.domain.Trip;
import com.itheima.mapper.TripMapper;
import com.itheima.service.TripService;
import org.apache.ibatis.annotations.Insert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TripServiceIml implements TripService {
@Autowired
private TripMapper tripMapper;

//        //查询所有数据
    public List<Trip> queryAll() {
        List<Trip> trips = tripMapper.queryAll();
        return trips;
}

//    //添加用户数据
  public void addTrip(Trip trip) {
 tripMapper.addTrip(trip);
    }
//    //根据id查询用户数据

    public Trip queryById(int i) {
        Trip trip = tripMapper.queryById(i);
        return trip;
    }
//    //根据id修改用户数据
public void updataByID(Trip trip2) {
tripMapper.updataByID(trip2);
}
//    //根据id删除用户数据
public void deteleById(int i) {
        tripMapper.deteleById(i);

}






}
